package grammar.parser.stmt;

import exp.parser.Exp;
import exp.parser.LVal;

public class ExpAssign extends Assign {
    public final Exp exp;

    public ExpAssign(LVal lVal, Exp exp) {
        super(lVal);
        this.exp = exp;
    }

    public static ExpAssign buildExpAssign(LVal lVal) {
        return new ExpAssign(lVal, Exp.buildExp());
    }

    @Override
    public void execute() {
        LVal lVal = getlVal();
        lVal.assign(exp.getValue());
    }
}
